import '~/style/about.less'
import LoadHead from '~/js/loadHead.js'

class about extends LoadHead{
  constructor () {
    super()
    this.isShowConfig = false
    this.init()
  }
  init () {
    console.log("登录")
    this.onChild()
    this.onConfig()
  }

  onChild () {
    $("#child").on("click", () => {
      window.location.href = '/about-child.html'
    })
  }

  onConfig () {
    $("#config").on("click", () => {
      this.isShowConfig = !this.isShowConfig
      if (!this.isShowConfig) {
        $(".foot").addClass('foot-config')
      }
      if (this.isShowConfig) {
        $(".foot").removeClass('foot-config')
      }
    })
    $(document).click( (e) => {
      const target = $(e.target)
      console.log('document target', target)
      if(target.closest("foot-config").length != 0) return
      if (target[0] !== $("#config") || target[0] !== $(".config")) {
        // $(".foot").removeClass('foot-config')
      }
      // $(".foot").removeClass('foot-config')
    })
  }

}

new about()



